import 'package:flutter/material.dart';

class CateGoryPage extends StatefulWidget {
  const CateGoryPage({Key? key}) : super(key: key);

  @override
  State<CateGoryPage> createState() => MyCardState();
}

class MyCardState extends State<CateGoryPage> {
  var _throwShotAway = false;

  @override
  Widget build(BuildContext context) {
    return Card(
      child: ListTile(
          title: const Text("duo_shine"),
          subtitle: const Text("duo_shine@163.com"),
          //之前显示icon
          leading: Icon(Icons.email, color: _throwShotAway ? Colors.blueAccent : Colors.redAccent),
          //之后显示checkBox
          trailing: Checkbox(value: _throwShotAway, onChanged: (bool? value) {
            setState(() {
              _throwShotAway = value!;
            });
          }) ),
    );
  }
}

